package com.lzc.controller;

import com.lzc.mapper.ErrorKeyMapper;
import com.lzc.pojo.vo.Result;
import com.lzc.service.ErrorKeyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 违禁词设置
 */
@RestController
@RequestMapping("/im/error/key")
public class ErrorKeyController {

    @Autowired
    private ErrorKeyService errorKeyService;

    /**
     * 插入违禁词
     * @param text 违禁词
     * @return 200
     */
    @PostMapping("/insert")
    public Result insertKey(@RequestParam("text") String text){
        return errorKeyService.insertKey(text);
    }

}
